Skip to content

BYO OpenRouter key on review page#13

Open
dangng2004 wants to merge 2 commits into
mainfrom
wip/byo-openrouter-key
Open

BYO OpenRouter key on review page#13
dangng2004 wants to merge 2 commits into
mainfrom
wip/byo-openrouter-key

Conversation

@dangng2004
Copy link
Copy Markdown
Contributor

@dangng2004 dangng2004 commented May 13, 2026

Summary

  • New always-visible BYO OpenRouter key panel on the upload page.
  • Copy explains the shared daily budget and asks users with their own keys to use them so more budget remains for users without keys.
  • Password input; key is sent as the `openrouter_api_key` form field and never stored client-side.
  • `BACKEND_URL` auto-detects localhost (so the same page works against a local uvicorn on port 8080 during dev) and otherwise points at the prod Cloud Run URL.

Paired backend PR

Requires the matching backend change to actually consume the key and skip rate-limiting: ChicagoHAI/openaireview-web-backend (WIP PR opened alongside this one).

Test plan

  • Submit without a key — existing rate-limited path
  • Submit with an invalid key — backend rejects with friendly error
  • Submit with a valid key — review runs against user's key; rate limit not consumed

Adds a prominent always-visible section on /review.html where users can
paste a personal OpenRouter key. When supplied, the backend uses it for
the review and bypasses the shared daily limit, leaving more of the
shared budget for less well-resourced users.

- New BYO key panel between the help text and the email field, on
  brand (accent-light bg + accent border) so it reads as a first-class
  option rather than a hidden tweak.
- Password input; key is sent as the `openrouter_api_key` form field
  and never persisted in the page.
- Backend URL auto-detects localhost vs production so the same page
  works against a local uvicorn (port 8080) during development.
@dangng2004
Copy link
Copy Markdown
Contributor Author

dangng2004 commented May 13, 2026

image

@dangng2004 dangng2004 marked this pull request as ready for review May 13, 2026 01:49
@dangng2004 dangng2004 changed the title WIP: BYO OpenRouter key on review page BYO OpenRouter key on review page May 13, 2026
Headline now leads with the concrete benefit (review the full paper,
not just the first 20 pages) and keeps the "leave more budget for less
well-resourced users" framing as the secondary reason.

Adds a Length dropdown inside the BYOK box with two options:
  * 20k tokens (~20 pages) — default
  * Full paper (up to 100 pages)

The selection is sent as the `tier` form field; the backend only
honors it when a BYO key is also supplied.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant